
<?php // CKEditor code for text editor
function text_editor($field_name, $value, $toolbar = "User", $cols = "80%", $rows = 10)
{
   include_once('../ckeditor/ckeditor.php');
   $CKEditor = new CKEditor();
   
   $CKEditor->basePath = '../ckeditor/';
   
   // Do not print the code directly to the browser, return it instead

   $CKEditor->returnOutput = true;
   
   // set the graphical look of CKEditor
   //$config['skin'] = 'office2003';   // default skin is -> kama   -->  available skins: kama, office2003, v2  --- uncomment line to use
   // User Interface Color, works only on default skin: kama
   $config['uiColor'] = '#AABBCC';  // User Interface Color ... sets CKEditor's toolbar gradient color
   
   // set up Width and Height of CKEditor
   $config['width'] = $cols;  // width can be set to pixels or percentage... For Example:  $config['width'] = 600;  -OR- $config['width'] = '90%';
   $config['height'] = $rows * 17;
   
   if($toolbar == "Basic") {
      $config['toolbar'] = array(
       array( 'Cut', 'Copy', 'PasteText', 'PasteFromWord', '-', 'Undo','Redo','-','BidiLtr', 'BidiRtl','-','Image'),'/',
       array( 'Bold', 'Italic', 'Underline', '-', 'HorizontalRule', '-', 'NumberedList','BulletedList','-','OrderedList','UnorderedList'));
	} else if($toolbar == "MyToolbar") {
	   $config['toolbar'] = array(
			array('Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo'),'/',
			array('NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl'),'/',
			array( 'Styles','Format','Font','FontSize', 'TextColor','BGColor'),'/',
			array('Link','Unlink','Anchor','-','Table','Horizontal Rule')
		);
	}
	echo $CKEditor->editor($field_name, $value, $config);	
	//echo $CKEditor->replace($field_name, $config);	

}
?>